' Random Colour Gradiant Animation Thing by Charlie Veniot
' This program built with BASIC Anywhere Machine Version 5.2.3_2023.01.13.04.25
' On 2023.01.13.04.26
dim as double r_i, g_i, b_i   ' 📝 red, green, blue increments between start and end colours
wsl = 1025 ' 📝 Width/Height of screen
screen _newimage(wsl, wsl, 32)
cc = int(wsl/2) ' 📝 Pixels between screen center and up/down/left/right edge of screen
s_r = -1 
do
  if s_r = -1 then
    s_r = int(rnd*256) : s_g = int(rnd*256) : s_b = int(rnd*256) ' 📝 First time in loop, we don't have a "last end colour"
  else
    s_r = e_r : s_g = e_g : s_b = e_b  ' 📝 Set start colour to last end colour
  end if
  e_r = int(rnd*256) : e_g = int(rnd*256) : e_b = int(rnd*256)  ' 📝 Set new end colour
' 📝 For number of pixels between center of screen to outer edge, figure out rgb component increments between start colour and end colour
  r_i =  (e_r - s_r )/cc  ' red
  g_i =  (e_g - s_g )/cc  ' green
  b_i =  (e_b - s_b )/cc  ' blue
  for i = 0 to (cc-2) step 1
    this_red = s_r + int(r_i * i)
    this_green = s_g + int(g_i * i)
    this_blue = s_b + int(b_i * i)
    line (cc-i+1,cc-i+1) - (cc+i+1,cc+i+1), _rgb32(this_red, this_green, this_blue), B
    _delay 0.0001
  next i
  _delay 0.25
loop